<?php
declare (strict_types = 1);

namespace app\api\controller;
use app\BaseController;
use app\common\lib\JwtToken;

class Controllers extends BaseController
{
    protected $token;
    protected $userinfo;
    /*
     * 鉴权登陆
     */
    protected function initialize(){

        $this->token = request()->header('Authorization');
        empty($this->token) && throwError('token不能为空');
        $this->userinfo = app(JwtToken::class)->decode($this->token)->data;

    }

}
